package team.qwer.demo.module1.dao;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import team.qwer.demo.module1.entity.Test;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2019/2/17 0017 14:03
 **/
@Repository
@Mapper
public interface TestDao {

    @Insert("INSERT INTO test(id, name) VALUES (#{id}, #{name})")
    int save(Test test);

    @Select("select * from test")
    List<Test> query();

    @Select("select * from test where name=#{name}")
    List<Test> queryByCondition(String name);
}
